﻿using UnityEngine;
using System.Collections;

public class GUImanager : MonoBehaviour
{
    public PlayerManager playerManager;
    private GUIText distanceCount;

	// Use this for initialization
	void Start () 
    {
        distanceCount = (GameObject.Find("GUI/GUI_BOTTOM_BAR/Distance Count")).guiText;
	}
	
	// Update is called once per frame
	void Update () 
    {
        distanceCount.text = ((int)playerManager.getDistance()).ToString() + Global.DISTANCE_COUNT_TEXT;
	}

    private void checkForInitErrors()
    {
        if (playerManager == null)
        {
            Debug.Log("GUImanager: Missing playerManager");
        }
    }
}
